package com.example.smartclassroom.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.smartclassroom.entity.Course;
import com.example.smartclassroom.entity.Examplan;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface CourseMapper extends BaseMapper<Course> {

    /**
     * 查询所有课程信息
     * @param course
     * @return
     */
    List<Course> selectAll(Course course);

    /**
     * 查询课程安排个数
     * @param course
     * @return
     */
    Integer selectTotal(Course course);

    /**
     * 根据room_id查询课程
     */
    @Select("select * from course where room_id = #{roomId}")
    List<Course> selectCourseByRoomId(Integer roomId);

    /**
     * 根据id查询课程
     */
    @Select("select * from course where id = #{id}")
    Course selectCourseById(Integer id);
}
